<%-- 
    Document   : viewLatestArticles
    Created on : Nov 22, 2011, 4:59:23 PM
    Author     : Breath
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<style type="text/css">
    table.sample {
        border-width: 0px;
        border-spacing: 2px;
        border-style: outset;
        border-color: gray;
        border-collapse: collapse;
        background-color:  aliceblue;
    }
    table.sample th {
        border-width: 2px;
        padding: 3px;
        border-style: solid;
        border-color: gray;
        background-color: aliceblue;
        -moz-border-radius:  ;
    }
    table.sample td {
        border-width: 2px;
        padding: 3px;
        border-style: solid;
        border-color: gray;
        background-color: aliceblue;
        -moz-border-radius: ;
    }


</style>

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>JSP Page</title>
        </head>
        <body>
        <h:form id="viewLatestArtForm" prependId="false">
            <h:dataTable styleClass="sample" id="table" value="#{articleBean.latestArticle}" var="art">
                <f:facet name="header">
                    <h:outputText value="My Articles" />
                </f:facet>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Id" />
                    </f:facet>
                    <h:outputText value="#{art.id}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Status" />
                    </f:facet>
                    <h:outputText value="#{art.status}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Date of publication" />
                    </f:facet>
                    <h:outputText value="#{art.date}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Title" />
                    </f:facet>
                    <h:outputText value="#{art.title}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Image" />
                    </f:facet>
                    <h:outputText value="#{art.image}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Article Text" />
                    </f:facet>
                    <h:outputText value="#{art.articleBody}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Tag" />
                    </f:facet>
                    <h:outputText value="#{art.tag}" />
                </h:column>

            </h:dataTable>
            <br/>
            <h:commandButton  action="#{articleBean.retrieveLatest()}" value="Show articles"/>
            <h:commandButton  immediate="true" action="/registeredMember_Menu.jsp" value="Back to main Menu"></h:commandButton>

            <br/>
        </h:form>
        </body>

    </html>
</f:view>

